home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
games
/
65
/
pascal
/
modem.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-10-16
|
2KB
|
58 lines
{ Useful modem routines.
Jim Ockers
RR#4 Box 209
Lockport, IL 60441
(815) 838-3603
Any comments, direct them to me.
This of course is not all original, off the top of my head I must thank
John Dillenburg, the author to "STV924", and OSS Customer Support. Thanks.
Include this file for modem routines such as input/output, carrier detect,
setting baud rate, and set/drop the DTR line. }
procedure ONGIBIT( BITMASK:INTEGER); XBIOS(29);
procedure OFFGIBIT( BITMASK: INTEGER); XBIOS(30);
procedure RSCONF(SPEED,CTL,UCR,RSR,TSR,SCR: INTEGER); XBIOS(15);
function INPUT_STATUS(DEVICE: INTEGER): BOOLEAN; BIOS(1);
function CHAR_IN(DEVICE: INTEGER): LONG_INTEGER; BIOS(2);
function OUTPUT_STATUS(DEVICE: INTEGER): BOOLEAN; BIOS(8);
procedure CHAR_OUT(DEVICE, CHAR: INTEGER); BIOS(3);
function SUPER( SP: LONG_INTEGER): LONG_INTEGER; GEMDOS($20);
procedure SET_DTR(SWITCH: BOOLEAN);
const
DTRON_MASK = $ef;
DTROFF_MASK = $10;
begin
if SWITCH then
ONGIBIT(DTRON_MASK)
else
OFFGIBIT(DTROFF_MASK);
end;
function CARRIER: BOOLEAN;
var
SSP, LOC: LONG_INTEGER;
begin
CARRIER := FALSE;
SSP := SUPER(0);
LOC := LPEEK($fffa00);
SSP := SUPER(SSP);
if LOC = -393472 then
CARRIER := TRUE;
end;
function CONSOLE_INPUT: INTEGER;
var
CH: LONG_INTEGER;
begin
CONSOLE_INPUT := -1;
if INPUT_STATUS(2) = TRUE then
begin
CH := CHAR_IN(2);
CONSOLE_INPUT := INT((SHR(CH,8) & $ff00) | (CH & $00ff));
end;
end;